package com.hundsun.yr.universal.p2p.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hundsun.mobile.zwgt.R;
import com.hundsun.yr.universal.library.eventbus.EventCenter;
import com.hundsun.yr.universal.library.netstatus.NetUtils;
import com.hundsun.yr.universal.library.widget.HSLabelTextView;
import com.hundsun.yr.universal.p2p.bean.MessageBean;
import com.hundsun.yr.universal.p2p.config.Extras;
import com.hundsun.yr.universal.p2p.ui.activity.base.BaseActivity;

/**
 * Created by apple on 2017/12/5.
 */

public class MessageDetailActivity extends BaseActivity {
//    private ImageView iv_icon_type = null;
    private TextView tv_title = null;
    private TextView tv_content = null;
    private TextView tv_time = null;
    private MessageBean mMessageBean = null;
    private HSLabelTextView hstv_icon_type = null;

    @Override
    protected boolean isApplyKitKatTranslucency() {
        return false;
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.act_message_detail;
    }

    @Override
    protected void initViewsAndEvents() {
        setToolbarTitle(R.string.message_detail);
        findView();
        switch (mMessageBean.type){
            case "1":
                hstv_icon_type.setText(getString(R.string.activity));
                hstv_icon_type.setBorderColor(getResources().getColor(R.color.orange_red));
                hstv_icon_type.setBackColor(getResources().getColor(R.color.orange_red));
                break;
            case "2":
                hstv_icon_type.setText(getString(R.string.bonus));
                hstv_icon_type.setBorderColor(getResources().getColor(R.color.md_orange_300));
                hstv_icon_type.setBackColor(getResources().getColor(R.color.md_orange_300));
                break;
            case "3":
                hstv_icon_type.setText(getString(R.string.system));
                hstv_icon_type.setBorderColor(getResources().getColor(R.color.md_light_blue_500));
                hstv_icon_type.setBackColor(getResources().getColor(R.color.md_light_blue_500));
                break;
            case "4":
                hstv_icon_type.setText(getString(R.string.product));
                hstv_icon_type.setBorderColor(getResources().getColor(R.color.md_color_11111));
                hstv_icon_type.setBackColor(getResources().getColor(R.color.md_color_11111));
                break;
        }

        tv_title.setText(mMessageBean.title);
        tv_content.setText(mMessageBean.text);
        tv_time.setText(mMessageBean.ctime);
    }

    private void findView() {
//        iv_icon_type = findView(R.id.iv_icon_type);
        hstv_icon_type = findView(R.id.hstv_icon_type);
        tv_title = findView(R.id.tv_title);
        tv_content = findView(R.id.tv_content);
        tv_time = findView(R.id.tv_time);
    }

    @Override
    protected void getBundleExtras(Bundle extras) {
        mMessageBean = (MessageBean) extras.get(Extras.MESSAGE_DATA);
    }

    @Override
    protected void onEveComming(EventCenter eventCenter) {

    }

    @Override
    protected boolean isBindEventBusHere() {
        return false;
    }

    @Override
    protected View getLoadingTargetView() {
        return null;
    }

    @Override
    protected void onNetworkConnected(NetUtils.NetType type) {

    }

    @Override
    protected void onNetworkDisConnected() {

    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean toggleOverridePendingTransition() {
        return false;
    }

    @Override
    protected TransitionMode getOverridePendingTransitionMode() {
        return null;
    }
}
